Title Case a Sentence-Javascript

72

Title Case a Sentence-Javascript -

function titleCase(str) {
  return str.toLowerCase().replace(/(^|\s)\S/g, L => L.toUpperCase());
}

Comments

Submit
0 Comments